package cc.openkit.admin.service.task.impl;

import cc.openkit.admin.dao.CompanyInfoMapper;
import cc.openkit.admin.dao.TaskMapper;
import cc.openkit.admin.model.Task;
import cc.openkit.admin.service.common.impl.BaseServiceImpl;
import cc.openkit.admin.service.task.TaskService;
import cc.openkit.admin.vo.GongZhangVo;
import cc.openkit.admin.vo.ProjectVo;
import cc.openkit.admin.vo.ShiGongVo;
import cc.openkit.admin.vo.TaskVo;
import com.github.pagehelper.PageHelper;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
@Transactional(rollbackFor = Exception.class)
public class TaskServiceImpl extends BaseServiceImpl<Task> implements TaskService {

    private Logger log = Logger.getLogger(this.getClass());

    Map<String,Object> map = new HashMap<String, Object>();

    @Resource
    private TaskMapper taskMapper;
    @Resource
    private CompanyInfoMapper companyInfoMapper;

    public List<TaskVo> findByUserAndTaskStatus(Task task) {
        return taskMapper.findByUserAndTaskStatus(task);
    }

    public Integer findCountByNewTask(String uid) {
        return taskMapper.findCountByNewTask(uid);
    }

    public Integer findCountByGoingTask(String uid) {
        return taskMapper.findCountByGoingTask(uid);
    }

    public Integer findCountByRefuseTask(String uid) {
        return taskMapper.findCountByRefuseTask(uid);
    }

    public List<TaskVo> findByUserFinishTask(Task task) {
        return taskMapper.findByUserFinishTask(task);
    }

    public List<ShiGongVo> findShiGong(String proId) {
        return taskMapper.findShiGong(proId);
    }

    public List<GongZhangVo> findGongZhang(String proId) {
        return taskMapper.findGongZhang(proId);
    }


}
